package com.by.component.importrecord.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.by.component.importrecord.ImportRecord;
import com.by.component.importrecord.dto.InfoImportRecordSDTO;
import com.by.component.importrecord.dto.ItemImportRecord4PageSDTO;
import org.apache.ibatis.annotations.Param;

/**
 * 导入记录(ImportRecord)表数据库访问层
 *
 * @author YanBingHao
 * @since 2024-09-09 14:14:43
 */
public interface ImportRecordMapper extends BaseMapper<ImportRecord> {

    Page<ItemImportRecord4PageSDTO> queryPage(@Param("page") Page<ItemImportRecord4PageSDTO> page, @Param("condition") ItemImportRecord4PageSDTO condition);

    int processing(@Param("recordId") Long recordId);

    int processed(@Param("recordId") Long recordId
            , @Param("importCount") Long importCount
            , @Param("successCount") Long successCount
            , @Param("errorCount") Long errorCount
            , @Param("fileOssUrl") String fileOssUrl);

    Long unProcessedId(@Param("sysUserId") Long sysUserId, @Param("importType") Integer importType);

    void failProcess(@Param("recordId") Long recordId, @Param("failMsg") String failMsg);

    InfoImportRecordSDTO recordInfo(@Param("recordId") Long recordId);

}
